home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.FilterInputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import symjava.lang.Bignum;
- import symjava.sql.Date;
- import symjava.sql.SQLException;
- import symjava.sql.Time;
- import symjava.sql.Timestamp;
-
- public abstract class Field extends ServerObject {
- int _type;
- int _id;
- boolean _null;
-
- int getBaseType() {
- return 57;
- }
-
- int getType() {
- return 1;
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- in.readShort();
- this._id = ((FilterInputStream)in).read();
- this._type = in.readShort();
- this._null = in.readByte() != 0;
- }
-
- void write(DataOutputStream out) throws IOException {
- out.writeByte(this.getType());
- out.writeShort(3);
- out.writeByte(this._id);
- out.writeShort(this._type);
- byte b = (byte)(!this._null ? 0 : 1);
- out.writeByte(b);
- }
-
- boolean storesData() {
- return true;
- }
-
- public boolean isNull() throws SQLException {
- return this._null;
- }
-
- public String getString() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public boolean getBoolean() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public byte getByte() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public short getShort() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public int getInt() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public long getLong() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public float getFloat() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public double getDouble() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public Bignum getBignum(int scale) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public byte[] getBytes() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public Date getDate() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public Time getTime() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public Timestamp getTimestamp() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public InputStream getAsciiStream() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public InputStream getUnicodeStream() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public InputStream getBinaryStream() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setNull(int sqlType) throws SQLException {
- this._null = true;
- }
-
- public void setBoolean(boolean x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setByte(byte x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setShort(short x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setInt(int x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setLong(long x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setFloat(float x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setDouble(double x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setBignum(Bignum x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setString(String x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setBytes(byte[] x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setDate(Date x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setTime(Time x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setTimestamp(Timestamp x) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setAsciiStream(InputStream x, int length) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setUnicodeStream(InputStream x, int length) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setBinaryStream(InputStream x, int length) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public int getSQLType() {
- return 1111;
- }
-
- public Object getObject() throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
-
- public void setObject(Object obj) throws SQLException {
- throw new SQLException("Can't convert data to requested format");
- }
- }
-